Merge with xen-unstable.hg (staging)
authorAlex Williamson <alex.williamson@hp.com>
Wed, 13 Jun 2007 02:41:08 +0000 (20:41 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Wed, 13 Jun 2007 02:41:08 +0000 (20:41 -0600)
1  2 
tools/libxc/ia64/xc_ia64_hvm_build.c

index 73fc03a597bfe2643d8a21e8cef281d9f2515d07,522ec2d03cd32a468a150406376d1b2c0a62ebae..f58573882ba5139d87a2d878e0d23011059e095d
@@@ -709,15 -708,19 +709,19 @@@ copy_from_GFW_to_nvram(int xc_handle, u
  
  int xc_ia64_save_to_nvram(int xc_handle, uint32_t dom) 
  {
 -      uint64_t nvram_fd = 0;
 -      xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
 +    uint64_t nvram_fd = 0;
 +    xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
  
 -      if ( !IS_VALID_NVRAM_FD(nvram_fd) )
 -              PERROR("Nvram not be initialized. Nvram save fail!\n");
 -      else
 -              copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd);  
 +    if ( !IS_VALID_NVRAM_FD(nvram_fd) )
-     {
 +        PERROR("Nvram not be initialized. Nvram save fail!\n");
-         return -1;
-     }
-     return copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd);     
++    else
++        copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd);        
+       
 -      // although save to nvram maybe fail, we don't return any error number
 -      // to Xend. This is quite logical because damage of NVRAM on native would 
 -      // not block OS's executive path. Return error number will cause an exception 
 -      // of Xend and block XenU when it destroy.
 -      return 0;
++    // although save to nvram maybe fail, we don't return any error number
++    // to Xend. This is quite logical because damage of NVRAM on native would 
++    // not block OS's executive path. Return error number will cause an
++    // exception of Xend and block XenU when it destroy.
++    return 0;
  }
  
  #define NVRAM_FILE_PATH       "/usr/lib/xen/boot/nvram_"
@@@ -988,24 -861,15 +992,26 @@@ setup_guest(int xc_handle, uint32_t dom
          goto error_out;
      }
  
 -      xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
 -      if ( !IS_VALID_NVRAM_FD(nvram_fd) )
 -              nvram_start = 0;
 -      else
 -              if ( copy_from_nvram_to_GFW(xc_handle, dom, (int)nvram_fd ) == -1 )
 -              {
 -                      nvram_start = 0;
 -                      close(nvram_fd);
 -              }
 +    if (xc_ia64_setup_memmap_info(xc_handle, dom, dom_memsize,
 +                                  pfn_list, nr_special_pages,
 +                                  memmap_info_pfn, memmap_info_num_pages)) {
 +        PERROR("Could not build memmap info\n");
 +        goto error_out;
 +    }
 +    if (xc_ia64_setup_shared_info(xc_handle, dom,
 +                                  domctl.u.getdomaininfo.shared_info_frame,
 +                                  memmap_info_pfn, memmap_info_num_pages)) {
 +        PERROR("Could not setup shared_info\n");
 +        goto error_out;
 +    }
 +
 +    xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
 +    if ( !IS_VALID_NVRAM_FD(nvram_fd) )
 +        nvram_start = 0;
-     else if ( copy_from_nvram_to_GFW(xc_handle, dom, (int)nvram_fd ) == -1 )
++    else if ( copy_from_nvram_to_GFW(xc_handle, dom, (int)nvram_fd ) == -1 ) {
 +        nvram_start = 0;
++        close(nvram_fd);
++    }
  
      vcpus = domctl.u.getdomaininfo.max_vcpu_id + 1;